# Maintainer: Antoni Aloy <aaloytorrens@gmail.com>
pkgname=featherpad
pkgver=1.4.1
pkgrel=0
pkgdesc="Lightweight Qt plain-text editor"
url="https://github.com/tsujan/FeatherPad"
license="GPL-3.0-or-later"
arch="all"
makedepends="
	cmake
	hunspell-dev
	libx11-dev
	qt6-qtbase-dev
	qt6-qtsvg-dev
	qt6-qttools-dev
	samurai
	"
subpackages="$pkgname-lang"
options="!check" # no test suite
source="https://github.com/tsujan/FeatherPad/releases/download/V$pkgver/FeatherPad-$pkgver.tar.xz"
builddir="$srcdir/FeatherPad-$pkgver"

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DBUILD_SHARED_LIBS=True \
		-DENABLE_QT5=OFF \
		$CMAKE_CROSSOPTS .
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

lang() {
	amove usr/share/featherpad/translations
}

sha512sums="
0f6ba174449c2d1a044dbac8641f443b1a9c1f92c74dbec8ddddce0096165a892da19f5aedbf935ed16a777358837a150f5ad133cc7a3cc76a56eaf3b6259e41  FeatherPad-1.4.1.tar.xz
"
